package com.example.demo.internettongxin.bsjiagouplus;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.Socket;

/**
 * @Description ServerThread
 * @Author songchuanlong
 * @Date 2025-05-30
 */
public class ServerThread implements Runnable{
    private Socket socket;
    public ServerThread (Socket socket){
        this.socket=socket;
    }

    @Override
    public void run() {
        try {
            OutputStream os = socket.getOutputStream();
            PrintStream ps = new PrintStream(os);
            ps.println("HTTP/1.1 200 OK");
            ps.println("Content-Type:text/html;charset=UTF-8");
            ps.println();
            ps.println("<div style='color:red;font-size:120px;text-align:center'>大姐，嘿嘿<div>");
            ps.close();
            socket.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
